HIGH C FROM METAWARE AND 80386 SOFTWARE DEVELOPMENT SERIES FROM PHAR LAP The High C compiler from MetaWare, Inc. (903 Pacific Ave., Suite 201, Santa Cruz, CA 95060-4429) is now in release 1.3 that produces code for execution on an 80386 in protected mode. I tested the compiler on a Compaq Deskpro 386 running Compaq's DOS version 3.10. High C programs may be configured to generate a variety of memory models: small, compact, medium, big, and large. On the low end, the small model requires that the code generated be less than 64K bytes (the code segment register remains fixed) - likewise, the program's data (including stack and heap) must fit within a 64K-byte segment. The large model permits the code segment register to be mobile, so that executable code may be greater than 64K bytes. Also, the DS (data segment) and ES (extra segment) registers are dynamic, permitting greater than 64K worth of data and heap space (only the stack is limited to 64K). The models between small and large incorporate combinations of static and dynamic code and data segments, so that from this selection, you should be able to choose a model that best suits your application. (The 80386 version of the compiler we tested currently only incorporates a version of the small memory model.) The list of Hich C's features are quite extensive, and include: * The ability to generate source code that can be tailored for use with assemblers. * Provides extensive compiler checking normally found in "lint" programs. Also includes type checking as specified in ANSI C. * Includes support for the 8087 and the 80287 math coprocessor chips. Special routines in the compiler detects the presence of a math coprocessor and sets a toggle that can be used to control compilation. * There are two object files provided with the High C compiler that, when linked with your program, generate post mortem dumps. One file contains code to dump the contents of the heap in the event of an error condition - the other will display the call-chain of currently active functions. * High C programs can make use of 'pragmas' - statements for controlling compiler parameters. For example, you can specify a directory search path, alter or re-instate compiler switches, perform conditional source-file includes, and more. Documentation for High C consists of a thick three-ring binder divided into three general sections: a programmer's guide, a library reference manual, and a language reference manual. Each section is well indexed, and there appear to be a fair number of code fragments included as examples. (The software we received came with a demonstration .BAT file that compiled and executed three example programs.) To execute code in protected mode, we used Phar Lap Software's 386LINK and RUN386 programs (see table 1). Execution time was so small that it was obvious the Compaq was spending more time loading the programs than executing them. 386LINK and RUN386 are part of Phar Lap Software, Inc.'s (60 Aberdeen Ave., Cambridge, MA 02138) 80386 Software Development Series. This package consists of the 386ASM assembler, the 386LINK linker, the MINIBUG debugger, and RUN386 runtime environment. Versions of this package are available for the IBM PC, IBM PC/AT, VAX/VMS and a number of UNIX systems; the version we tested was running on a Compaq 386 Deskpro running Compaq's DOS version 3.10. 386ASM is a full-featured macro assembler with enough option switches to allow generation of code for practically every Intel processor since the 8088 (8088, 8086, 80186, 80286, and 80386). You can also assemble instructions for either the 80287 or 8087 numeric coprocessors. In operation, 386LINK acts much like any other linker, combining object files to create an MS-DOS .EXE file (you can optionally output the program in Intel hex file format). The MINIBUG debugger allows debugging of 80386 programs in either real mode or protected mode. It can be run on MS-DOS, can manage up to 4 breakpoints, and boasts commands similar to the standard MS-DOS/PC-DOS DEBUG program. Additonally, MINIBUG incorporates an online help screen that is invoked by entering a questionmark. RUN386 creates an 80386 protected-mode runtime environment within MS-DOS. This means that programmers may work within the familiar MS-DOS world, creating applications that make full use of the 80386's power plus enjoy access to the standard MS-DOS system calls. (Some system calls are not supported: specifically, those involving memory allocation and interrupt vector manipulation.) RUN386 initializes necessary descriptors, loads the application into memory, switches into protected mode, and passes control to the application program. RUN386 will also transfer command line arguments to the application, and intercept all hardware interrupts to pass them along to standard interrupt handlers. We rewrote the C version of the sieve program into 80386 assembler and ran it through 386ASM, 386LINK, and RUN386. Assemble time was less than 4 seconds, link time was less than 2, and execute time was so short that in order to make measurements we had to increase the number of iterations from 10 to 50. We then measured the program's execution time at 3.5 seconds. Phar Lap's 386ASM manual was in second draft when we received it, and weighed in at 238 pages with no index (we sincerely hope they include one). The 386LINK, MINIBUG, and RUN386 manuals were in better shape - being 62, 54, and 21 pages, respectively (and with indices). !TABLE1! Compile/Link File Size Execute Time Time (sec) (bytes) (sec) Sieve 14/21 34896 <1 Sort 15/21 30888 1 !ENDTABLE1! !CAPTIONS! Table 1. Peformance benchmarks for High C compiler. The generated code was executed using Phar Lap Software, Inc.'s RUN386 program that allows 80386 protected-mode programs to run within an MS-DOS environment.